#include <iostream>
using namespace std;
const int N = 2010;
char s[N];
int n;

void solve() {
    int i = 0, j = n - 1;
    while(i <= j) {
        bool left = false;
        for(int k = 0; i + k <= j; k++) {
            if(s[i + k] < s[j - k]) {
                left = true;
                break;
            }else if(s[i + k] > s[j  -k]) {
                break;
            }
        }
        if(left) putchar(s[i++]);
        else putchar(s[j--]);
    }
    cout << '\n';
}

int main(){    
    cin >> n;
    for(int i = 0; i < n; i++){
        getchar();
        scanf("%c", &s[i]);
    }
    solve();
    return 0;
}